package com.mcc.myapplication.hello;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

import com.mcc.myapplication.R;
import com.mcc.myapplication.databinding.ActivityHelloBinding;

public class HelloActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hello);
        findViewById(R.id.hello_btn).setOnClickListener(v -> closeActivity(v));
    }


    public void closeActivity(View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
//        Intent messageIntent = new Intent(this, MainActivity.class);
//        startActivity(messageIntent);
        Log.i("HelloActivity", "closeActivity");
        finish();
    }
}